package edu.zut.hb.software.hospital.service.impl;


import edu.zut.hb.software.base.service.impl.GenericTreeManagerImpl;
import edu.zut.hb.software.hospital.dao.HospitalDao;
import edu.zut.hb.software.hospital.domain.Hospital;
import edu.zut.hb.software.hospital.service.HospitalService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import javax.transaction.Transactional;
import java.util.ArrayList;
import java.util.List;

@Service
@Transactional
public class HospitalServiceImpl extends GenericTreeManagerImpl<Hospital, Long>
        implements HospitalService {


    HospitalDao hospitalDao;

    @Autowired
    public void HospitalDao(HospitalDao hospitalDao) {
        this.hospitalDao = hospitalDao;
        this.treeDao=hospitalDao;
        this.dao=treeDao;
    }

    @Override
        public List list() {
            List list = new ArrayList();
            for (int i = 0; i < 100; i++) {
                Hospital hospital = new Hospital();
                hospital.setName("医院名称"+i);
                hospital.setAddress("医院地址"+i);
                hospital.setPhone("电话号码"+i);
                list.add(hospital);
            }
            return list;

        }




}
